package com.zto.tbschedule.console.conf;

import com.zto.tbschedule.console.zookeeper.ZKManager;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix="zookeeper")
public class ZookeeperConfig {
    private String ip;
    private String port;
    private Integer timeout;
    @Bean(name = "zkManager")
    public ZKManager zkManagerConfigurer() {
        return  new ZKManager(ip+":"+port,timeout);
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }
}
